package com.shph.test.rule;

import com.shph.validation.Validator;
import com.shph.validation.rule.IRule;

public class NameNotNullRule implements IRule<String> {
    @Override
    public boolean test(String value, String refValue) {
        if (Validator.isEmpty(value)) {
            throw new RuntimeException();
        }

        if (value.length() < 5) {
            throw new RuntimeException();
        }
        return true;
    }
}
